package com.sbtr.business.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.sbtr.business.system.entity.HelpParam;
import com.sbtr.business.system.dto.HelpParamDto;

import com.sbtr.business.system.service.HelpParamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sbtr.business.system.mapper.HelpParamMapper;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sbtr.common.PageDto;
import com.sbtr.util.PageDtoUtils;
import org.springframework.transaction.annotation.Transactional;

/**
 * 帮助说明参数字段列表 Service接口实现类
 *
 * @author dgl
 * @since  2023-07-19
 */
@Transactional
@Service
public class HelpParamServiceImpl extends ServiceImpl<HelpParamMapper,HelpParam> implements HelpParamService {

    @Autowired
    HelpParamMapper helpParamMapper;

    @Override
    public PageDto<HelpParam> pageList(HelpParamDto helpParamDto) {

        IPage<HelpParam> page = new Page<>();
        page.setSize(helpParamDto.getPageSize());
        page.setCurrent(helpParamDto.getPage());
        page = helpParamMapper.selectPages(page, BeanUtil.beanToMap(helpParamDto));
        PageDto<HelpParam> r = PageDtoUtils.getPageDtoByIPage(page, HelpParam.class);

        return r;
    }
}

